package com.sean.designpatterns.create.singleton;

public class SingleObject4 {
    private volatile static SingleObject4 singleton;

    private SingleObject4() {

    }

    public static SingleObject4 getInstance() {

        if (singleton == null) {
            synchronized (SingleObject4.class) {
                if (singleton == null) {
                    singleton = new SingleObject4();
                }
            }
        }
        return singleton;
    }

}
